package org.idea.spring.task.dao;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.idea.spring.task.model.CronSetting;

import java.util.List;

/**
 * @author idea
 * @data 2019/1/15
 */
public interface CronSettingDao {

    static final String TABLE_NAME = "t_cron_setting";

    /**
     * 查找所有的定时任务配置信息
     *
     * @return
     */
    @Select("select * from " + TABLE_NAME)
    List<CronSetting> selectAllCron();

    /**
     * 根据bean的名字进行搜索
     *
     * @param name
     * @return
     */
    @Select("select * from " + TABLE_NAME + " where name=#{name}")
    CronSetting selectOneByCronName(@Param("name") String name);
}
